﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using Dataglot;

namespace IrishSettings
{
    internal class ConfigUtils
    {
        public static DataFactory DefaultDataFactory()
        {
            DataFactory factory = new DataFactory(ConfigurationManager.AppSettings["Dataglot.ConnectionStringName"]);
            return factory;
        }

        public static string ConnectionString()
        {
            string name = ConfigurationManager.AppSettings["Dataglot.ConnectionStringName"];
            return ConfigurationManager.ConnectionStrings[name].ConnectionString;//OledbSql
        }

        public static string Provider()
        {
            string name = ConfigurationManager.AppSettings["Dataglot.ConnectionStringName"];
            return ConfigurationManager.ConnectionStrings[name].ProviderName;//OledbSql
        }

        public static string OleDbConnectionString()
        {
            string name = ConfigurationManager.AppSettings["Dataglot.ConnectionStringName"];
            return ConfigurationManager.ConnectionStrings[name].ConnectionString;//OledbSql
        }
    }
}
